# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=kubectl-cert-manager
pkgver=1.13.3
pkgrel=0
pkgdesc="Manage and configure cert-manager resources for Kubernetes"
url="https://cert-manager.io/"
license="Apache-2.0"
arch="all !armhf !riscv64" # limited by kubectl
depends="kubectl"
makedepends="go"
source="https://github.com/cert-manager/cert-manager/archive/v$pkgver/kubectl-cert-manager-$pkgver.tar.gz"
builddir="$srcdir/cert-manager-$pkgver/cmd/ctl"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build \
		-ldflags "-X github.com/cert-manager/cert-manager/pkg/util.AppVersion=v$pkgver"
}

check() {
	go test ./...
}

package() {
	install -Dm755 ctl "$pkgdir"/usr/bin/kubectl-cert_manager
}

sha512sums="
ab8d05a09bee1c92b4e68d57ccee9406211b02f75d6faa6b4b54ac2f49c9954de24d93467849f7d295a6b69838465bf11d420ce48e75ba9cd1946f99205c3798  kubectl-cert-manager-1.13.3.tar.gz
"
